home *** CD-ROM | disk | FTP | other *** search
/ AOL File Library: 9,300 to 9,399 / 9300.zip / AOLDLs / HTML & Web Tools (MAC) / HTML_ Format HTML 1.0 for BBEdit / Format HTML 1.0.sit / Format HTML 1.0 / Format HTML Read Me next >
Text File  |  1996-02-11  |  7KB  |  108 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8. A BBEdit Extension for quickly formatting HTML
  9. Copyright ⌐1996, by Chad Magendanz.  All rights reserved.
  10.  
  11. Version 1.0 - 10 Feb 96
  12.  
  13.  
  14. Description
  15.  
  16. Format HTML was created for two basic purposes:
  17.  
  18. 1.  To display Web pages generated with PageMill in readable form:
  19.  
  20. I'm a big fan of PageMill.  It provides a means of generating very simple Web pages with almost instant gratification.  However, it's rare that I'm completely satisfied with the results of my Web page after its initial conception in PageMill.  I usually wish to add some more complex structures (like tables) and find myself back in BBEdit flirting with HTML tags in their native form.  Unfortunately, this is often easier said than done.  PageMill doesn't lay out the HTML in any particular format, frequently squishing them all together in a mass of tags that are difficult for humans to interpret.
  21.  
  22. Format HTML was designed to quickly fix this problem, breaking down HTML tags into individual lines and indenting them in a programmatic style that is easier to read and understand.  The utility makes a great addition to Lindsay Davies' HTML Tools, complementing the PageMill Cleaner utility.  When importing HTML from PageMill to BBEdit, I first use PageMill Cleaner, then Format HTML to set things right.
  23.  
  24. 2.  To assist Web authors in debugging their HTML: 
  25.  
  26. The Check HTML command in HTML Tools is a probably the most useful element of BBEdit's Web authoring environment.  Like the best compilers, BBEdit displays which tags are likely to be problems and suggests a reasonable cause.  Frequently, the solution is obvious, but for those cases where it's not, Format HTML can be a valuable tool.  Just running your HTML through Format HTML will tell you whether you have balanced all of your HTML tags and quickly indicate when a tag block has not been closed properly.
  27.  
  28. Installation
  29.  
  30. Install Format HTML by decompressing the StuffIt¬ archive and dragging the BBEdit Extension to your BBEdit Extension folder.  If you have Lindsay Davies' HTML Tools installed, you will probably want to place Format HTML in the Misc folder with PageMill Cleaner.  In either case, the new Format HTML command should be available from the Extensions menu the next time you launch BBEdit.
  31.  
  32. System Requirements
  33.  
  34. Format HTML requires BBEdit version 3.5 or later.  BBEdit Lite will *not* suffice.  For more information on BBEdit, check out the BBEdit Web site at www.barebones.com.
  35.  
  36.  
  37. What it Actually Does
  38.  
  39. Format HTML conducts several operations on your HTML source in one command.  Specifically,
  40.  
  41. 1.  All extraneous tabs, spaces and returns are removed.
  42.  
  43. 2.  Each HTML tag is placed on its own line.
  44.  
  45. 3.  HTML commands are parsed for basic structure (not syntax).
  46.  
  47. 4.  Tabs are added to each line to indent appropriately for its level of nesting.
  48.  
  49.  
  50. Using Format HTML
  51.  
  52. To format any HTML file in BBEdit, just select the Format HTML command from the Extensions menu.  To undo the changes, just select Undo Extension from the Edit menu.
  53.  
  54. >> Note: It is good practice whenever first using the first release of a new utility to keep a backup of whatever source you feed it.  Format HTML is no exception. <<
  55.  
  56. Changing Tab Indents:
  57.  
  58. The default tab stop is 4 characters.  You can change this setting to suit your taste using the Fonts & Tabs command from the Text menu.  Changes will be reflected immediately in your file.  The use of tabs also allows you to adjust block indentation using the Shift Left and Shift Right commands.
  59.  
  60. Customization:
  61.  
  62. Format HTML can be customized to some extent by editing several resources with ResEdit.  This should normally not be required and is not for the faint of heart.  However, HTML tags appear and disappear fairly quickly these days and I've provided a basic mechanism to keep Format HTML updated as new tags fall in and out of favor.
  63.  
  64. Here is a quick description of the resources involved:
  65.  
  66. Target Strings (STR#128), Substitute Strings (STR#129) - These two resources indicate which substitutes are immediately made on your file.  They are preset to remove extraneous tabs, spaces and returns.  If you decide to edit these, keep in mind that you must do so using the Hex Editor, since the non-visible ASCII codes like HT and CR are difficult to enter in the STR# template editor.
  67.  
  68. >> Note: Format HTML actually replaces *all* occurrences of the Target String for its respective Substitute String.  Beware of substituting a string that contains the target string, as this will cause your machine to hang. <<
  69.  
  70. Open Tags (STR#130) - This presently only consists of a one character string tag "<", indicating a tag that is opening a block and should cause all following lines to be indented in one tab stop.  Theoretically, you could itemize *each* tag that you wish to have this behavior, but this would be a long list.
  71.  
  72. Close Tags (STR#131) - This presently only consists of a two character string tag "</", indicating a tag that is closing a block and should cause it and all following lines to moved out one tab stop.   As with the Open Tag, you could itemize each tag that you wish to have this behavior.
  73.  
  74. Exceptions Tags (STR#132) - This resource lists all tags that have no corresponding close tag.  The list I've supplied is current to the best of my knowledge, but it has not been adjusted for new extensions currently being added by Netscape and Microsoft.  If you find a new tag that stands alone with no closing form, add it here.
  75.  
  76. >> Note: HTML lines are parsed in the following order: Exception Tags, Close Tags and finally Open Tags.  When a tag is identified, the parser looks no further.  Parsing is also not case sensitive. <<
  77.  
  78. Known Problems
  79.  
  80. 1. Since each HTML command is currently placed on its own line, most browsers show an extra space underlined at the end of Anchor and Underline tag blocks.  This must currently be corrected by hand.
  81.  
  82. 2. The HTML+ version of the Paragraph tag is *not* an Exception Tag and has both opening and closing forms.  If you consistently use the Paragraph tag in this form, you should remove it from the Exception Tags list using the customization instructions above.
  83.  
  84.  
  85. Format HTML is Freeware
  86.  
  87. Freeware is copyrighted software freely distributed via the Internet, local bulletin board systems (BBS), commercial on-line services, user groups, and between friends.  There is no charge for individual or commercial use of Format HTML.
  88.  
  89. Keep in mind that Format HTML is copyrighted and that no one has the right to sell or alter it in any way without my written consent.  I also will not be liable for any damages, including lost of data, lost profits, cost of cover or other special, incidental, consequential or indirect damages arising from the use of this program.
  90.  
  91.  
  92. Contacting the Author
  93.  
  94. I am not planning to actively support Format HTML, since it was just a quick hack.  (Yes, Peter!  Slightly longer than 4 hours.)  However, if you would like to obtain the latest version of ShrinkWrap¬, suggest new features, or complain about a bug, just contact me at:
  95.  
  96. E-mail:
  97.   Internet: chad@halcyon.com (preferred)
  98.   America Online & eWorld: Magendanz
  99.  
  100. World Wide Web:
  101.   http://www.halcyon.com/shrinkwrap/
  102.  
  103. Address:
  104.   Chad Magendanz
  105.   15220 263rd Ave. SE
  106.   Issaquah, WA USA
  107.